<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTopupRebateRechargeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('topup_rebate_recharge', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->integer('order_id')->default(0)->comment('订单');
            $table->integer('price')->default(0)->comment('充值金额');
            $table->integer('diamond_value')->default(0)->comment('返利金额');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('topup_rebate_recharge');
    }
}
